﻿using DocumentFormat.OpenXml.Lite.WordprocessingML.Word.Types;
using DocumentFormat.OpenXml.Lite.Xml;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Schema;
using System.Xml.Serialization;

namespace DocumentFormat.OpenXml.Lite.WordprocessingML.Drawing
{
    [XmlRoot("wrapNone", Namespace = Constants.Drawing)]
    public class WrapNone : XmlSerializable, IWrapType
    {
        public WrapNone() { }
    }

    [XmlRoot("wrapSquare", Namespace = Constants.Drawing)]
    public class WrapSquare : XmlSerializable, IWrapType
    {
        [XmlAttribute("wrapText", Form = XmlSchemaForm.Qualified)]
        public ST_WrapText WrapText { get; set; }

        [Optional]
        [XmlAttribute("distT", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> DistanceFromTop { get; set; }

        [Optional]
        [XmlAttribute("distB", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> DistanceFromBottom { get; set; }

        [Optional]
        [XmlAttribute("distL", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> DistanceFromLeft { get; set; }

        [Optional]
        [XmlAttribute("distR", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> DistanceFromRight { get; set; }

        [Optional]
        [XmlElement("effectExtent", Namespace = Constants.Drawing)]
        public EffectExtent EffectExtent { get; set; }

        public WrapSquare() { }
    }

    [XmlRoot("wrapTight", Namespace = Constants.Drawing)]
    public class WrapTight : XmlSerializable, IWrapType
    {
        [XmlAttribute("wrapText", Form = XmlSchemaForm.Qualified)]
        public ST_WrapText WrapText { get; set; }

        [Optional]
        [XmlAttribute("distL", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> DistanceFromLeft { get; set; }

        [Optional]
        [XmlAttribute("distR", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> DistanceFromRight { get; set; }

        [Optional]
        [XmlElement("wrapPolygon", Namespace = Constants.Drawing)]
        public WrapPolygon WrapPolygon { get; set; }

        public WrapTight() { }
    }

    [XmlRoot("wrapThrough", Namespace = Constants.Drawing)]
    public class WrapThrough : XmlSerializable, IWrapType
    {
        [XmlAttribute("wrapText", Form = XmlSchemaForm.Qualified)]
        public ST_WrapText WrapText { get; set; }

        [Optional]
        [XmlAttribute("distL", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> DistanceFromLeft { get; set; }

        [Optional]
        [XmlAttribute("distR", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> DistanceFromRight { get; set; }

        [Optional]
        [XmlElement("wrapPolygon", Namespace = Constants.Drawing)]
        public WrapPolygon WrapPolygon { get; set; }

        public WrapThrough() { }
    }

    [XmlRoot("wrapTopAndBottom", Namespace = Constants.Drawing)]
    public class WrapTopAndBottom : XmlSerializable, IWrapType
    {
        [Optional]
        [XmlAttribute("distT", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> DistanceFromTop { get; set; }

        [Optional]
        [XmlAttribute("distB", Form = XmlSchemaForm.Qualified)]
        public Nullable<uint> DistanceFromBottom { get; set; }

        [Optional]
        [XmlElement("effectExtent", Namespace = Constants.Drawing)]
        public EffectExtent EffectExtent { get; set; }

        public WrapTopAndBottom() { }
    }
}
